package com.richly.conf;

import org.apache.iotdb.session.pool.SessionPool;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: l_y
 * @Date: 2022/6/10 9:48
 * @FileName: IotDBConf
 * @Description:
 */

@Configuration
public class IotDBSessionConfig {

    @Value("${spring.iotdb.username}")
    private String userName;

    @Value("${spring.iotdb.password}")
    private String password;

    @Value("${spring.iotdb.ip}")
    private String ip;

    @Value("${spring.iotdb.port}")
    private int port;

    @Value("${spring.iotdb.maxSize}")
    private int maxSize;

    @Bean
    public SessionPool getSessionPool() {
       return new SessionPool(ip, port, userName, password, maxSize);
    }

}
